package com.hjj.service.impl;

import com.powernode.commons.ResultEnum;
import com.powernode.commons.ResultException;
import com.powernode.pojo.User;
import com.hjj.service.UserService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
@Service
public class UserServiceimpl implements UserService {

    @Override
    public List<User> findByList() {
        List<User> users = new ArrayList<User>();
        users.add(new User(1,"zhangsan1","GZ"));
        users.add(new User(2,"zhangsan2","GZ"));
        users.add(new User(3,"zhangsan3","GZ"));
        if (users.size() == 0 ){
            throw new ResultException(ResultEnum.NOT_FOUND);
        }
        return users;
    }
}
